package com.bosch.in.rtp1.ept.action.form;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;

import com.bosch.in.rtp1.ept.constant.TableType;
import com.bosch.in.rtp1.ept.model.dto.ScrollingColumn;

/**
 * Class is used to store parameters which are conditions to set the skipped finished recipes
 * @author LIV1HC
 *
 */

public class FrozenColumnForm extends ActionForm{
	
	private static final long serialVersionUID = 1L;
	
	private String lotStatusStartScrollingCol;
	private String releasedHoldStartScrollingCol;
	
	private List<String> lotStatusCols = new ArrayList<String>();
	private List<String> releasedHoldCols = new ArrayList<String>();
	
	public FrozenColumnForm() {
		lotStatusCols.add("No Column");
		releasedHoldCols.add("No Column");
	}
	
	public String getLotStatusStartScrollingCol() {
		return lotStatusStartScrollingCol;
	}
	public void setLotStatusStartScrollingCol(String lotStatusScrollingCol) {
		this.lotStatusStartScrollingCol = lotStatusScrollingCol;
	}
	public String getReleasedHoldStartScrollingCol() {
		return releasedHoldStartScrollingCol;
	}
	public void setReleasedHoldStartScrollingCol(String releasedHoldScrollingCol) {
		this.releasedHoldStartScrollingCol = releasedHoldScrollingCol;
	}
	public List<String> getLotStatusCols() {
		return lotStatusCols;
	}
	public void setLotStatusCols(List<String> lotStatusCols) {
		this.lotStatusCols = lotStatusCols;
	}
	public List<String> getReleasedHoldCols() {
		return releasedHoldCols;
	}
	public void setReleasedHoldCols(List<String> releasedHoldCols) {
		this.releasedHoldCols = releasedHoldCols;
	}
	
	
	public List<ScrollingColumn> getScrollingColumnList() {
		List<ScrollingColumn> scrollingColumns = new ArrayList<ScrollingColumn>();
		
		if (lotStatusStartScrollingCol != null && !lotStatusStartScrollingCol.isEmpty()) {
			ScrollingColumn scrollingColumn = new ScrollingColumn(lotStatusStartScrollingCol, TableType.LOT_STATUS);
			scrollingColumns.add(scrollingColumn);
		}
		
		if (releasedHoldStartScrollingCol != null && !releasedHoldStartScrollingCol.isEmpty()) {
			ScrollingColumn scrollingColumn = new ScrollingColumn(releasedHoldStartScrollingCol, TableType.RELEASED_HOLD);
			scrollingColumns.add(scrollingColumn);
		}
		
		return scrollingColumns;
	}
}
